package com.ruoyi.dynamic.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dynamic.mapper.UserDynamicCommentMapper;
import com.ruoyi.dynamic.domain.UserDynamicComment;
import com.ruoyi.dynamic.service.IUserDynamicCommentService;

/**
 * 动态评论Service业务层处理
 * 
 * @author DEREK
 * @date 2023-06-19
 */
@Service
public class UserDynamicCommentServiceImpl extends ServiceImpl<UserDynamicCommentMapper, UserDynamicComment> implements IUserDynamicCommentService 
{
    @Autowired
    private UserDynamicCommentMapper userDynamicCommentMapper;

    /**
     * 查询动态评论
     * 
     * @param id 动态评论主键
     * @return 动态评论
     */
    @Override
    public UserDynamicComment selectUserDynamicCommentById(Long id)
    {
        return userDynamicCommentMapper.selectUserDynamicCommentById(id);
    }

    /**
     * 查询动态评论列表
     * 
     * @param userDynamicComment 动态评论
     * @return 动态评论
     */
    @Override
    public List<UserDynamicComment> selectUserDynamicCommentList(UserDynamicComment userDynamicComment)
    {
        return userDynamicCommentMapper.selectUserDynamicCommentList(userDynamicComment);
    }

    /**
     * 新增动态评论
     * 
     * @param userDynamicComment 动态评论
     * @return 结果
     */
    @Override
    public int insertUserDynamicComment(UserDynamicComment userDynamicComment)
    {
        userDynamicComment.setCreateTime(DateUtils.getNowDate());
        return userDynamicCommentMapper.insertUserDynamicComment(userDynamicComment);
    }

    /**
     * 修改动态评论
     * 
     * @param userDynamicComment 动态评论
     * @return 结果
     */
    @Override
    public int updateUserDynamicComment(UserDynamicComment userDynamicComment)
    {
        return userDynamicCommentMapper.updateUserDynamicComment(userDynamicComment);
    }

    /**
     * 批量删除动态评论
     * 
     * @param ids 需要删除的动态评论主键
     * @return 结果
     */
    @Override
    public int deleteUserDynamicCommentByIds(Long[] ids)
    {
        return userDynamicCommentMapper.deleteUserDynamicCommentByIds(ids);
    }

    /**
     * 删除动态评论信息
     * 
     * @param id 动态评论主键
     * @return 结果
     */
    @Override
    public int deleteUserDynamicCommentById(Long id)
    {
        return userDynamicCommentMapper.deleteUserDynamicCommentById(id);
    }
}
